package com.humanmonth.util.text
{
	/**xml工具类
	 * @author 林子龙 
	 */
	public class XMLUtil
	{
		public static var xmlHeader:String="<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
		public function XMLUtil()
		{
		}
		  
		/**
		 * 开始标签 
		 */
		public static function getStarttag(tagName:String):String{
			return "<"+tagName+">";
		}
		
		/**
		 * 结束标签 
		 */
		public static function getEndTag(tagName:String):String{
			return "</"+tagName+">";
		}
		
		/**
		 * 构建带数据标签的xml 
		 */
		public static function buildXmlWithDataTag(tagName:String,content:*):String{
			return XMLUtil.getStarttag(tagName)+"<![CDATA["+content+"]]>"+XMLUtil.getEndTag(tagName);
		}
		
		/**
		 * 构建不带数据标签到的xml 
		 */
		public static function buildXml(tagName:String,content:*):String{
			return XMLUtil.getStarttag(tagName)+content+XMLUtil.getEndTag(tagName);
		}

	}
}